#ifndef SYSTEM_H
#define SYSTEM_H

#include <iostream>
#include <boost/tokenizer.hpp>
#include <string>

#include "Helper.h"
#include "Table.h"

#include "CreateCommand.h"
#include "InsertCommand.h"
#include "SelectCommand.h"
#include "UnloadCommand.h"
#include "DropCommand.h"
#include "DeleteCommand.h"
#include "EbookCommand.h"
#include "WebsiteCommand.h"
#include "LogCommand.h"
#include "EmailCommand.h"
#include "Constants.h"
#include "UpdateCommand.h"

#define SELECT_COMMAND 1
#define CREATE_COMMAND 2
#define DROP_COMMAND 3

using namespace std;
using namespace boost;

class InsertCommand;
class SelectCommand;
class DropCommand;
class DeleteCommand;
class UnloadCommand;
class CreateCommand;
class EbookCommand;
class WebsiteCommand;
class EmailCommand;
class LogCommand;
class Command;
class UpdateCommand;




class SQLSystem
{
public:
	SQLSystem();
	~SQLSystem();
	vector<Table *> getAllTables();
	Table* getTableByName(string name);
	int getTableIndex(string table);
	void removeTable(string name);
	void addTable(Table* table);
	void startup();
	void input();
	void process();
	void run();
	void initWebsiteTable();
	void initEbookTable();
	void initEmailTale();
	void initLogTable();
private:
	
	string statement;
	vector<Table *> tables;
	Helper* helper;
	InsertCommand *cmdInsert;
	SelectCommand *cmdSelect;
	DeleteCommand *cmdDelete;
	DropCommand *cmdDrop;
	CreateCommand *cmdCreate;
	UnloadCommand *cmdUnload;
	EbookCommand *cmdEbook;
	WebsiteCommand *cmdWebsite;
	LogCommand *cmdLog;
	EmailCommand *cmdEmail;
	UpdateCommand *cmdUpdate;
};

#endif
